#include "stu_mod_dialog.h"
#include "ui_stu_mod_dialog.h"

stu_mod_Dialog::stu_mod_Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::stu_mod_Dialog),
    flag(false),
    student({"","","","",""})
{
    ui->setupUi(this);

}

stu_mod_Dialog::~stu_mod_Dialog()
{
    delete ui;
}

void stu_mod_Dialog::printfData()
{
    ui->lineEdit_number->setText(student[0]);
    ui->lineEdit_name->setText(student[1]);
    ui->comboBox_mojar->setEditText(student[2]);
    ui->comboBox_class->setEditText(student[3]);
    ui->lineEdit_booknum->setText(student[4]);
}

void stu_mod_Dialog::on_pushButton_OK_clicked()
{
    this->flag=true;
    student[0] = ui->lineEdit_number->text();
    student[1] = ui->lineEdit_name->text();
    student[2] = ui->comboBox_mojar->currentText();
    student[3] = ui->comboBox_class->currentText();
    student[4] = ui->lineEdit_booknum->text();
    this->close();
}

void stu_mod_Dialog::closeEvent(QCloseEvent *event)
{
    this->close();
}

void stu_mod_Dialog::on_pushButton_Canle_clicked()
{
    this->close();
}
